package com.bnz.service.impl;

import com.bnz.mapper.ClassesMapper;
import com.bnz.pojo.Classes;
import com.bnz.service.ClassesService;
import com.bnz.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * 类名：班级数据库访问类
 * 作者：WF
 * 功能：
 */
public class ClassesServiceImpl implements ClassesService {
	private ClassesMapper classesMapper;

	//1. 查询所有的班级列表
	@Override
	public List<Classes> findAll() {
		try(SqlSession session = MybatisUtil.getSqlSession()){
			classesMapper = session.getMapper(ClassesMapper.class);
			return classesMapper.findAll();
		}
	}
}
